home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 2
/
DOS031.dsk
/
LIFE.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
2KB
|
39 lines
5 IF PEEK(8192) = 254 THEN CALL 8170: POKE 8192,0: RUN
6 HIMEM: 16384: GOSUB 500
10 HOME : VTAB 3: PRINT "INPUT ARRAY DIMENSIONS:"
12 VTAB 5: INPUT " MINIMUM AND MAXIMUM X-VALUES - ";XL,XH
14 IF XL <1 OR XH >38 OR XL >XH THEN 12
16 VTAB 7: INPUT " MINIMUM AND MAXIMUM Y-VALUES - ";YL,YH
18 IF YL <1 OR YH >46 OR YL >YH THEN 16
20 VTAB 11: PRINT "DO YOU WANT NEW GENERATIONS TO BE": INPUT "DISPLAYED AUTOMATICALLY? ";A$:AU = ( LEFT$(A$,1) = "Y")
25 POKE 1144,XL: POKE 1145,XH: POKE 1146,YL: POKE 1147,YH
30 ST = 8192
40 XL = XH -XL +1:YL = YH -YL +1:YL = XL *YL: FOR XL = 1 TO YL: IF RND(1) <.5 THEN POKE ST,0: GOTO 44
42 POKE ST,15
44 ST = ST +1: NEXT
45 GR : HOME : POKE -16302,0: CALL -1998
46 YL = 2000/ SQR(YL): GOTO 50
47 P = PEEK( -16384): IF AU = 0 THEN IF P <128 THEN 47
48 POKE -16368,0: IF P = 155 THEN 70
49 IF P = 129 THEN AU = AU -1
50 CALL 8039: CALL 8103
55 IF AU = 1 THEN FOR X = 1 TO Y: NEXT
60 GOTO 47
70 POKE -16301,0: HOME : INPUT "WANT TO TRY ANOTHER PATTERN ? ";A$: IF LEFT$(A$,1) = "Y" THEN X = FRE(0): TEXT : GOTO 10
80 TEXT : HOME : END
400 POKE 71,0: POKE 58,44: POKE 59,254: CALL 65209: RETURN
500 GR : POKE 60,0: POKE 61,19: POKE 62,255: POKE 63,22: POKE 66,0: POKE 67,4: GOSUB 400
510 POKE 1144,5: POKE 1145,34: POKE 1146,14: POKE 1147,28: CALL 8103
520 IF PEEK( -16384) <128 THEN 520
530 POKE -16368,0: CALL 8039
540 IF PEEK( -16384) <128 THEN 540
550 TEXT : POKE -16368,0: POKE 60,0: POKE 61,23: POKE 62,255: POKE 63,26: POKE 66,0: POKE 67,4: GOSUB 400
560 IF PEEK( -16384) <128 THEN 560
570 POKE -16368,0: POKE 60,0: POKE 61,27: POKE 62,255: POKE 63,30: POKE 66,0: POKE 67,4: GOSUB 400
580 IF PEEK( -16384) <128 THEN 580
590 POKE -16368,0: RETURN
1000 POKE 8190, PEEK(175): POKE 8191, PEEK(176): POKE 8192,254
1010 POKE 105,0: POKE 106,32: POKE 175,0: POKE 176,32
1020 PRINT "START TAPE, THEN HIT ANY KEY"
1030 IF PEEK( -16384) <128 THEN 1030
1040 POKE -16368,0: SAVE : RETURN